package cn.wolfcode.shop.mapper;

import cn.wolfcode.shop.domain.OrderInfo;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

@Mapper
public interface OrderInfoMapper {
    @Insert("insert into t_order_info (order_no,user_id,good_id,good_img,delivery_addr_id," +
            "good_name,good_count,good_price,seckill_price,status,create_date,pay_date)" +
            "values (#{orderNo},#{userId},#{goodId},#{goodImg},#{deliveryAddrId}," +
            "#{goodName},#{goodCount},#{goodPrice},#{seckillPrice},#{status}," +
            "#{createDate},#{payDate})")
    int insert(OrderInfo orderInfo);
    @Select("select * from t_order_info where order_no = #{orderNo}")
    OrderInfo selectByOrderNo(String orderNo);
}
